<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改公告类别')"/>
    <th:block th:include="include :: ztree-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-edit" th:object="${KnowledgeBenchmarking}">
        <input id="project_id" name="project_id" type="hidden" th:field="*{project_id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label ">项目名称：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="project_name" id="project_name" th:field="*{project_name}" required>
            </div>
        </div>





        <div class="form-group">
            <label class="col-sm-3 control-label">开始时间：</label>
            <div class="col-sm-9">
                <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>

                    <input type="text" name="project_start" id="project_start" class="form-control" th:field="*{project_start}" required >
                </div>
            </div>
            <label class="col-sm-3 control-label">结束时间：</label>
            <div class="col-sm-9">
                <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>

                    <input type="text" class="form-control" name="project_end" id="project_end" th:field="*{project_end}" required >
                </div>
            </div>
        </div>



        <div class="form-group">
            <label class="col-sm-3 control-label">项目简介：</label>
            <div class="col-sm-8">
                <input id="project_info" name="project_info" class="form-control" type="text" th:field="*{project_info}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">文件：</label>
            <div class="col-sm-8">
                <input id="file" name="file" class="form-control" type="file" th:field="*{project_file}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">项目类别：</label>
            <div class="col-sm-9">
                <label class="radio-box">
                    <div>
                        <input type="radio" checked="" value="2" id="project_type1" name="project_type" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>

                    </div>软装</label>
                <label class="radio-box">
                    <div>
                        <input type="radio" value="1" id="project_type2" name="project_type" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>

                    </div>硬装</label>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-select-js" />
<th:block th:include="include :: summernote-js" />
<th:block th:include="include :: bootstrap-fileinput-js" />
<script type="text/javascript">

    function edit() {
        var project_id = $("input[name='project_id']").val();
        var project_name = $("input[name='project_name']").val();
        var project_start = $("input[name='project_start']").val();
        var project_end = $("input[name='project_end']").val();
        var project_info = $("input[name='project_info']").val();
        var project_filt = $("input[name='project_filt']").val();
        var project_type = $("input:radio[name='project_type']:checked").val();
        console.info(project_start,project_end)
        $.ajax({
            cache: true,
            type: "POST",
            url: ctx + "knowledgemanagement/knowledgeBenchmarking/edit",
            data: {
                "project_id": project_id,
                "project_name": project_name,
                "project_start": project_start,
                "project_end": project_end,
                "project_info": project_info,
                "project_filt": project_filt,
                "project_type": project_type,
            },
            async: false,
            error: function (request) {
                $.modal.alertError("系统错误");
            },
            success: function (data) {
                $.operate.successCallback(data);
            }
        });
    }

    // 点击确定按钮回调方法
    function submitHandler() {
        edit();
    }
</script>
</body>
</html>
